home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
DISPLYTT.MOD
< prev
next >
Wrap
Text File
|
1987-07-22
|
5KB
|
100 lines
(*----------------------------------------------------------------------*)
(* Display_Transfer_Types --- Display transfer type menu *)
(*----------------------------------------------------------------------*)
PROCEDURE Display_Transfer_Types( Direction : ShortStr;
VAR Transfer_Kind : Transfer_Type );
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Display_Transfer_Types *)
(* *)
(* Purpose: Display transfer type menu. *)
(* *)
(* Calling Sequence: *)
(* *)
(* Display_Transfer_Types( Direction : ShortStr; *)
(* VAR Transfer_Kind : Transfer_Type ); *)
(* *)
(* Direction --- string giving direction of transfer *)
(* Transfer_Kind --- Type of transfer protocol to be used *)
(* *)
(*----------------------------------------------------------------------*)
VAR
Transfer_Menu : Menu_Type;
Transfer_Menu_Size : INTEGER;
I : INTEGER;
J : INTEGER;
Default : INTEGER;
T : Transfer_Type;
Transfer_Names : AnyStr;
Trans_Prots : ARRAY[1..Max_Transfer_Types] OF Transfer_Type;
BEGIN (* Display_Transfer_Types *)
(* Figure number of transfer types *)
(* defined *)
Transfer_Menu_Size := 15;
Transfer_Names := 'Ascii;Xmodem (Checksum);Xmodem (CRC);Kermit;Telink;Modem7 (Checksum);' +
'Modem7 (CRC);Xmodem 1K;Xmodem 1K G;Ymodem Batch;' +
'Ymodem G Batch;Zmodem;WXmodem;RLink;SeaLink;';
(* Copy in types of built-in protocols *)
Default := -1;
FOR I := 1 TO 15 DO
BEGIN
Trans_Prots[I] := Transfers[I];
IF ( Default_Transfer_Type = Trans_Prots[I] ) THEN
Default := I;
END;
(* Add names of user-defined protocols *)
(* to list. *)
FOR T := PUser1 TO PUser5 DO
IF ( Trans_Type_Name[T] <> ' ' ) THEN
BEGIN
Transfer_Names := Transfer_Names +
LTrim( Transfer_Name_List[SUCC(ORD(T))] ) + ';';
Transfer_Menu_Size := SUCC( Transfer_Menu_Size );
Trans_Prots[Transfer_Menu_Size] := T;
IF ( Default_Transfer_Type = Trans_Prots[Transfer_Menu_Size] ) THEN
Default := Transfer_Menu_Size;
END;
(* Assume Xmodem checksum if we didn't *)
(* find it. *)
IF ( Default < 0 ) THEN Default := 2;
(* Get transfer menu *)
Make_A_Menu( Transfer_Menu, Transfer_Menu_Size, 3, 10, 50, 21, Default,
'Choose file transfer protocol for ' + Direction + ':',
Transfer_Names, TRUE );
(* Alter item positions if > 15 *)
IF ( Transfer_Menu_Size > 11 ) THEN
FOR I := 12 TO Transfer_Menu_Size DO
WITH Transfer_Menu.Menu_Entries[I] DO
BEGIN
Menu_Item_Row := Transfer_Menu.Menu_Entries[I - 11].Menu_Item_Row;
Menu_Item_Column := Transfer_Menu.Menu_Entries[I - 11].Menu_Item_Column + 30;
END;
(* Get transfer type *)
Menu_Display_Choices( Transfer_Menu );
I := Menu_Get_Choice( Transfer_Menu , Dont_Erase_Menu );
(* Get transfer protocol *)
IF ( I > 0 ) THEN
BEGIN
Transfer_Kind := Trans_Prots[ I ];
Default_Transfer_Type := Transfer_Kind;
END
ELSE
Transfer_Kind := None;
END (* Display_Transfer_Types *);